package club.vann.mock.web.service;

import club.vann.mock.db.entity.SystemConfigEntity;
import club.vann.mock.db.repository.SystemConfigRepository;
import club.vann.mock.model.enums.SystemConfigType;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;

@Log4j2
@RequiredArgsConstructor
@Service
public class SystemConfigService {
  private final SystemConfigRepository systemConfigRepository;

  /**
   * 查询所有系统配置。
   *
   * @return 系统配置列表
   */
  public List<SystemConfigEntity> list() {
    return systemConfigRepository.findAll();
  }

  public List<SystemConfigEntity> listByType(SystemConfigType type) {
    return systemConfigRepository.findByType(type);
  }
}
